package com.itstu.gulimall.product.web;

import com.itstu.gulimall.product.service.SkuInfoService;
import com.itstu.gulimall.product.vo.SkuItemVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author shhjiang_001
 * @create 2020-05-27 19:28
 */
@Controller
public class itemController {
    @Autowired
    SkuInfoService skuInfoService;
    @GetMapping({"/{skuId}.html"})
    public String skuItem(@PathVariable("skuId") Long skuId){
        System.out.println("准备查"+skuId+"的详情");
        SkuItemVo vo = skuInfoService.item(skuId);
        // item需要视图解析器配置，然后跳转，不能直接访问
        return "item";
    }
}
